<include file="Public/min-header"/>
<div class="wrapper">
    <!-- Content Header (Page header) -->
   <include file="Public/breadcrumb"/>
    <section class="content">
    <!-- Main content -->
    <!--<div class="container-fluid">-->
    <div class="row">
      <div class="col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-list"></i> 用户信息</h3>
            </div>
            <div class="panel-body">
                <form action="" method="post" onsubmit="return checkUserUpdate(this);">
                    <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <td class="col-sm-2">会员昵称:</td>
                        <td ><input type="text" class="form-control" name="nickname" value="{$user.nickname}"></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>用户积分:</td>
                        <td>{$user.pay_points} <span style="margin-left:100px;">账户余额：{$user.user_money}</span></td>
                        <td></td>
                    </tr>

                    <!-- <tr>
                        <td>邮件地址:</td>
                        <td><input type="text" class="form-control" name="email" value="{$user.email}"></td>
                        <td>电子邮箱</td>
                    </tr> -->
                    <tr>
                        <td>新密码:</td>
                        <td><input type="password" class="form-control" name="password"></td>
                    
                    </tr>
                    <tr>
                        <td>确认密码:</td>
                        <td><input type="password" class="form-control" name="password2" ></td>
                      
                    </tr>
                    <!--<tr>-->
                        <!--<td>会员等级:</td>-->
                        <!--<td>{$user.user_rank}</td>-->
                    <!--</tr>-->
                    <tr>
                        <td>性别:</td>
                        <td id="order-status">
                            <input name="sex" type="radio" value="0" <if condition="$user['sex'] eq 0">checked</if> >保密
                            <input name="sex" type="radio" value="1" <if condition="$user['sex'] eq 1">checked</if> >男
                            <input name="sex" type="radio" value="2" <if condition="$user['sex'] eq 2">checked</if> >女
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>年龄:</td>
                        <td>
                            <input class="form-control" type="text" name="age" value="{$user.age}">
                        </td>
                        <td></td>
                    </tr>
					
                    <tr>
                        <td>手机:</td>
                        <td>
                            <input type="text" class="form-control" name="mobile" value="{$user.mobile}">
                        </td>
                        <td></td>
                    </tr>
					
					
					<tr>
                        <td>第一栏</td>
                        <td>
                        
                    <?php $i = 1;?>
					<foreach name='bz[0]' item ='v'>
					
						<input type="checkbox" name="tizheng1[]" <?php if(strpos($user['tizheng1'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach>
						</td>
                    </tr>
					
					<tr>
                        <td>第二栏</td>
                        <td>
                        
                       
                    <?php $i = 1;?>
					<foreach name='bz[1]' item ='v'>
						<input type="checkbox" name="tizheng2[]" <?php if(strpos($user['tizheng2'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					
					
					<tr>
                        <td>心脑血管方面</td>
                        <td>
                        
                       
                    <?php $i = 1;?>
					<foreach name='bz[2]' item ='v'>
						<input type="checkbox" name="tizheng3[]" <?php if(strpos($user['tizheng3'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					
					
					<tr>
                        <td>泌尿系统方面</td>
                        <td>
                        
                       
                    <?php $i = 1;?>
					<foreach name='bz[3]' item ='v'>
						<input type="checkbox" name="tizheng3[]" <?php if(strpos($user['tizheng3'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					
					
					<tr>
                        <td>骨关节方面</td>
                        <td>
                        
                       
                    <?php $i = 1;?>
					<foreach name='bz[4]' item ='v'>
						<input type="checkbox" name="tizheng3[]" <?php if(strpos($user['tizheng3'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					
					<tr>
                        <td>其他病症</td>
                        <td>
                        
                       
                    <?php $i = 1;?>
					<foreach name='bz[5]' item ='v'>
						<input type="checkbox" name="tizheng3[]" <?php if(strpos($user['tizheng3'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					<tr>
                        <td>个人性格</td>
                        <td>
                        
                    <?php $i = 1;?>
                       
					<foreach name='bz[6]' item ='v'>
						<input type="checkbox" name="tizheng4[]" <?php if(strpos($user['tizheng4'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					<tr>
                        <td>舌苔</td>
                        <td>
                        
                       
                    <?php $i = 1;?>
					<foreach name='bz[7]' item ='v'>
						<input type="checkbox" name="tizheng5[]" <?php if(strpos($user['tizheng5'],$v['bz_name']) !== false) echo "checked";?>  value="{$v.bz_name}" >{$v.bz_name}
						<?php
						 if($i%5 == 0) echo "<br>";
						 $i++;
						?>
						</foreach></td>
                    </tr>
					
					
					
					<tr>
						<td>最想解决的疾病</td>
						<td><textarea rows="4" cols="120" placeholder="最想解决的疾病" name="ywdc" >{$user.ywdc}</textarea></td>
					</tr>
					
                    
                    <tr>
                        <td>病例</td>
                        <td><textarea rows="4" cols="120" placeholder="病例" name="bingli" >{$user.bingli}</textarea></td>
                    </tr>
                    
					<tr>
					<td>附件</td>
                       <td>                                                            
                                    <foreach name="goodsImages" item="vo" key="k" >
                                        <div style="width:100px; text-align:center; margin: 5px; display:inline-block;" class="goods_xc">
                                            <input type="hidden" value="{$vo['image_url']}" name="store_logo[]">
                                            <a onclick="" href="{$vo['image_url']}" target="_blank"><img width="100" height="100" src="{$vo['image_url']}"></a>
                                            <br>
                                            <a href="javascript:void(0)" onclick="ClearPicArr2(this,'{$vo['image_url']}')">删除</a>
                                        </div>
                                    </foreach>
                                    
                                        <div class="goods_xc" style="width:100px; text-align:center; margin: 5px; display:inline-block;">
                                            <input type="hidden" name="store_logo[]" value="" />
                                            <a href="javascript:void(0);" onclick="GetUploadify(10,'','goods','call_back2');"><img src="/Public/images/add-button.jpg" width="100" height="100" /></a>
                                            <br/>
                                            <a href="javascript:void(0)">&nbsp;&nbsp;</a>
                                        </div>                                        
                                    </td>
					</tr>
                    <tr>
                        <td></td>
                        <td>
                            <foreach name="tx" item="vo">

                               <if condition="$vo.store_logo neq  null ">
                                <img  src="{$vo.store_logo}" width="200px" heght="100px"/>
                                 <a href="{:U('Seller/user/del',array('id'=>$vo['id']))}">删除</a>
                                </if>
                                
                            </foreach>
                        </td> 
                        
                    </tr>
                    <tr>
                        <td>注册时间:</td>
                        <td>
                            {$user.reg_time|date='Y-m-d H:i',###}
                        </td>
                        <td></td>
                    </tr>
                     <tr>
					 <td>
					 理疗师:
					 </td>
					 <td>
                     <input type="" name="tuixiao_id" value='{$tui.user_id}' hidden>
                    {$tui.nickname}
                     <!-- <select name ="tuixiao_id">
                                          <foreach name='tgy' item ='v'>
                                              <option value="{$v.user_id}"
                         <if condition="$v['user_id'] eq $user['tuixiao_id']">selected = "selected"</if> >
                                              {$v.nickname}</option>
                                          </foreach>
                                                         
                                          </select> -->
                     </td>
					 </tr>   
                   <!--  <tr display: nologin>
                                           <td>是否分销:</td>
                                           <td id="order-status">                            
                                               <input name="is_distribut" type="radio" value="1" <if condition="$user['is_distribut'] eq 1">checked</if> >是
                                               <input name="is_distribut" type="radio" value="0" <if condition="$user['is_distribut'] eq 0">checked</if> >否
                                           </td>
                                           <td></td>
                                       </tr> -->                    
                    <tr>
                        <table  class="table table-bordered">
                            <foreach name ='xiaxianname' item='xiaxian'>
                            <tr>
                                <td>下线昵称</td>
                                <td>{$xiaxian.nickname}</td>
                            </tr>
                        </foreach>

                                              
                        </table>
                    </tr>  
                     <if condition="$user.list eq 1 ">
                    <tr>
                        <table  class="table table-bordered">
                           <foreach name="fuwu" item="v" >
								<tr>
                                    <td>用户服务项目</td>
                                    <td>{$v.goods_name}</td>                                
                                    <td>服务次数</td>
                                    <td>{$v.count}</td> 
                                    <td>剩余服务次数</td>
                                    <td>{$v.sycs}</td> 
                                   <if condition="$v.sycs egt 1">  
								   <td> 
								   <input class="but1" type="button" group_id="{$tui.user_id}" user_id="{$user.user_id}" order_id="{$v.order_id}"  value="-" />
                                    </td> 
                                   </if>
								   
									
                                </tr> 
						   </foreach>
                                 
                           
                                                      
                            
                                                             
                                              
                        </table>
                        <table class="table table-bordered">
                            <tr>
                                <td>服务项目</td>
                                <td>店铺</td>
                                <td>理疗师</td>
                                <td>操作时间</td>
                            </tr>
                            <foreach name="result" item="vo" >
                            <tr>
                                
                                <td>{$vo.goods_name}</td>
                                <td>{$vo.store_name}</td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.shijian|date='Y-m-d H:i',###}</td>
								
								<td><a href="{:U('user/user_print',array('id'=>$vo['id']))}" target="_blank" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="打印订单">
	                     <i class="fa fa-print"></i>打印订单
	                  </a></td>
                                
                            </tr>
                             </foreach>
                        </table>
                    </tr>
                     </if>
                    <tr>
                        <td></td>
                    </tr>            
                    <tr>
                        <td></td>
                        <td>
                            <button type="submit" class="btn btn-info">
                                <i class="ace-icon fa fa-check bigger-110"></i> 保存
                            </button>
                            <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default pull-right" data-original-title="返回"><i class="fa fa-reply"></i></a>
                        </td>
                    </tr>
                    </tbody>
                </table>
                </form>

            </div>
        </div>
 	  </div> 
    </div>    <!-- /.content -->
   </section>
</div>
<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script> 
<script>
    function checkUserUpdate(){
        var email = $('input[name="email"]').val();
        var mobile = $('input[name="mobile"]').val();
        var password = $('input[name="password"]').val();
        var password2 = $('input[name="password2"]').val();

        var error ='';
        if(password != password2){
            error += "两次密码不一样\n";
        }

        //if(!checkEmail(email)){
            //error += "邮箱地址有误\n";
       // }
        //if(!checkMobile(mobile)){
           // error += "手机号码填写有误\n";
       // }
        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        return true;

    }
	
	
	$(".but1").each(function(){
			$(this).click(function(){
				 var con;
				
				var user_id = $(this).attr("user_id");
				var group_id = $(this).attr("group_id");
				var order_id = $(this).attr("order_id");
				con=confirm("你确定要服务吗？"); //在页面上弹出对话框
				//alert(group_id);
				if(con==true)
				$.ajax({
					type: 'POST', 
					url:"{:U('Seller/user/liliao')}",
					data:{user_id:user_id,group_id:group_id,order_id:order_id},//这里data传递过去的是序列化以后的字符串    
					success:function(data){    
						  if(data.status == 1){
				　　           alert(data.info);
							window.location.reload();//刷新当前页面.
				　　           
				　　      }else{
				　　          alert('错误');
				　　      }
					}    
				});
		
			})
			});
	
	
    function li(){
        var user_id = $('input[name="user_id"]').val();
        var group_id = $('input[name="group_id"]').val();
		var order_id = $('input[name="order_id"]').val();
		
		
		
		console.log($(this).index()); 
		
        
       
    }
 /*
     * 以下是图片上传方法
     */
 
    // 上传商品图片成功回调函数
    function call_back(fileurl_tmp){
        $("#original_img").val(fileurl_tmp);
        $("#original_img2").attr('href', fileurl_tmp);
    }
 
    // 上传商品相册回调函数
    function call_back2(paths){
        
        //alert(paths.length);
        
        var  last_div = $(".goods_xc:last").prop("outerHTML");  
        for (i=0;i<paths.length ;i++ )
        {                    
            $(".goods_xc:eq(0)").before(last_div);  // 插入一个 新图片
                $(".goods_xc:eq(0)").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
            $(".goods_xc:eq(0)").find('img').attr('src',paths[i]);// 修改他的图片路径
                $(".goods_xc:eq(0)").find('a:eq(1)').attr('onclick',"ClearPicArr2(this,'"+paths[i]+"')").text('删除');
            $(".goods_xc:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
        }              
    }
</script>

</body>
</html>